/**
 * @ClassName LC495
 * @Author ykx
 * @Date 2024/7/1 20:32
 * @Version 1.0
 */
public class LC495 {
    public static void main(String[] args) {

    }

    public int findPoisonedDuration(int[] timeSeries, int duration) {
        int result = duration;

        for (int i = 1; i < timeSeries.length; i++) {
            result += Math.min(duration, timeSeries[i] - timeSeries[i - 1]);

        }

        return result;
    }

}
